﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Spanner
{
    internal class ModelContext
    {
        internal Model Model;

        internal List<IVar> ObsVars = new List<IVar> { }; // If B depends on A, then A must appear earlier in the list.

        internal List<IVar> ForEachObsVars = new List<IVar> { };

        internal Dictionary<IVar, string> ImportedLibraryModelIVarToName = new Dictionary<IVar, string> { };

        internal bool IsImportedIVar(IVar x)
        {
            return ImportedLibraryModelIVarToName.ContainsKey(x);
        }

        internal Namer VarNamer = new Namer { NewNamePrefix = "_x" };

        internal string VarName(IVar x)
        {
            return x.Kind == VarKind.Param ? (x.BaseName ?? "$xyz") : VarNamer.Name(x);
        }
    }
}
